<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta content="IE=edge" http-equiv="X-UA-Compatible">
    <meta content="width=device-width, initial-scale=1.0" name="viewport">
    <title>Document</title>
</head>

<body>
<div id="app">
    <div v-for="(floor,i) in floors">
        <h2>{{floor.title}}</h2>
        <ul>
            <li v-for="(item, index) in floor.items">
                <h4>商品名字:{{item.name}}</h4>
                <p>商品价格:{{item.price}}</p>
                {{ i + 1 }} 楼
            </li>
        </ul>
    </div>
</div>
<script src="./vue.js"></script>
<script>
    const vm = new Vue({
        el: '#app',
        data: {
            floors: [
                {
                    title: '手机',
                    items: [
                        {
                            name: '手机1',
                            price: 10
                        },
                        {
                            name: '手机2',
                            price: 20
                        },
                        {
                            name: '手机3',
                            price: 30
                        }
                    ]
                },
                {
                    title: '电脑',
                    items: [
                        {
                            name: '电脑1',
                            price: 10
                        },
                        {
                            name: '电脑2',
                            price: 20
                        },
                        {
                            name: '电脑3',
                            price: 30
                        }
                    ]
                },
                {
                    title: '相机',
                    items: [
                        {
                            name: '相机1',
                            price: 10
                        },
                        {
                            name: '相机2',
                            price: 20
                        },
                        {
                            name: '相机3',
                            price: 30
                        }
                    ]
                }
            ]
        }
    })
</script>
</body>

</html>